<?php
class MagicTest {
    # use for string
    public function __tostring() {
        return "This is the Class MagicTest" . "<br>";
    }

    # use for method
    public function __invoke($x) {
        echo "__invoke called with parameter " . $x . "<br>";
    }
}

$obj = new MagicTest();

echo $obj;

$obj("This is a magicTest");
?>
